package com.itheima.controller;

import com.itheima.dtos.LoginAuthDto;
import com.itheima.service.UserService;
import com.itheima.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjiexin
 */
@RestController
@RequestMapping("/api/v1/login")
public class LoginController {
    @Autowired
    private  UserService userService;
    @PostMapping("/login_auth")
    public CommonResult loginAuth(@RequestBody LoginAuthDto dto){

        return CommonResult.success(userService.login(dto));

    }
}
